^
1

Details — A single action in detail.
About the action rulebooks  


Standard actions which change the state of things
Locking it with , Unlocking it with , Switching on , Switching off , Opening , Closing , Wearing , Taking off 


Locking something with something (past tense locked it with)

Locking is the act of using an object such as a key to ensure that something such as a door or container cannot be opened unless first unlocked. (Only closed things can be locked.)

Locking can be performed on any kind of thing which provides the either/or properties lockable, locked, openable and open. The 'can't lock without a lock rule' tests to see if the noun both provides the lockable property, and if it is in fact lockable: it is then assumed that the other properties can safely be checked. In the Standard Rules, the container and door kinds both satisfy these requirements.

We can create a new kind on which opening, closing, locking and unlocking will work thus: 'A briefcase is a kind of thing. A briefcase can be openable. A briefcase can be open. A briefcase can be lockable. A briefcase can be locked. A briefcase is usually openable, lockable, open and unlocked.'

Inform checks whether the key fits using the 'can't lock without the correct key rule'. To satisfy this, the actor must be directly holding the second noun, and it must be the current value of the 'matching key' property for the noun. (This property is seldom referred to directly because it is automatically set by assertions like 'The silver key unlocks the wicket gate.')

The Standard Rules provide locking and unlocking actions at a fairly basic level: they can be much enhanced using the extension Locksmith by Emily Short, which is included with all distributions of Inform.


Typed commands leading to this action

"lock [something] with [something]" 

"lock [an unlocked lockable thing] with [something]" 

"lock [a lockable thing] with [something]" 

Rules controlling this action

before    someone trying locking an open thing (called the door ajar) with something  intelligently closing doors rule    name  unlist 

before    locking an open thing (called the door ajar) with something  closing doors before locking rule    name  unlist   1 


check    an actor locking something with  can't lock without a lock rule    name  unlist   1

check    an actor locking something with  can't lock what's already locked rule    name  unlist   1

check    an actor locking something with  can't lock what's open rule    name  unlist   1

check    right second rule    name  unlist   1 

check     

      NB: the right second rule is listed instead of the can't lock without the correct key rule in the check locking it with rulebook 

carry out    locking something with a passkey  standard passkey locking rule    name  unlist 

carry out    an actor locking something with  standard locking rule    name  unlist


report    someone trying locking something with a passkey  observe someone locking rule    name  unlist 

report    an actor locking something with  standard report locking rule    name  unlist   2


Click on the speech-bubble icons to see the responses, or here to see all of them:  7